const colors = require('colors')
const express = require('express')
const app = express()

const fs = require('fs')

var request = require('request')

var options = {
  url: 'https://shop.spacex.com/'
}

function callback(error, response, body) {
  console.log(response.statusCode)
  console.log(body)
  if (error) {
    console.warn(error)
  }
  if (!error && response.statusCode == 200) {
    console.log(body)
  }
}

request(options, callback)

let server = app.listen(30010, function () {
  let host = '127.0.0.1'
  let port = server.address().port
  console.log(`Your App is running at http://${host}:${port}`.green)
})

app.get('/', function (req, res) {
  res.send('Hello World!')
})
